package com.aco.party.model.vo;

import com.aco.party.enums.DataBaseEnum;
import com.aco.party.model.po.Product;
import static com.aco.party.util.DateUtil.*;
import lombok.Data;

/**
* Created by flying on 3/10/2016 0010.
*/
@Data
public class ProductVo extends Product {
    private String createTimeStr;
    private String updateTimeStr;

    private String typeStr;

    private Long views;

    private String platformStr;
    private String creatorStr;
    private String statusStr;

    public String getCreateTimeStr() {
        if(this.getCreateTime() != null)
            return dateToString(this.getCreateTime(),DATETIME_FORMAT);
        return "";
    }

    public String getUpdateTimeStr() {
        if(this.getUpdateTime() != null)
            return dateToString(this.getUpdateTime(),DATETIME_FORMAT);
        return "";
    }

    public String getStatusStr(){
        return DataBaseEnum.getDataBaseEnum(this.getStatus()).getDesc();
    }
}
